<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function getSum2(a, b, ...arr) {
            let sum = 0
            sum += a
            sum += b
            for (let i = 0; i < arr.length; i++) {
                sum += arr[i]
            }
            return sum
        }
        function getSum() {
            let sum = 0
            for (let i = 0; i < arguments.length; i++) {
                sum += arguments[i]
            }
            return sum
        }
        let sum = getSum(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
        console.log(sum)
        sum1 = getSum2(1, 2)
        console.log(sum1)
        let sum2 = getSum2(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
        console.log(sum + sum1 + sum2)
    </script>
</body>

</html>